﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleTest
{
  unsafe  class Program
    {
        static void Main(string[] args)
      {
            #region 程序集、模块和IL语言
            //ConsoleTest.AssemblyStruct.JustTest();
            // global::ConsoleTest.ChapterOne.ResourceAndLocalization.UseOutFile();
            //global::ConsoleTest.ChapterOne.ResourceAndLocalization.UseIDEAddFile();
            //global::ConsoleTest.ChapterOne.ResourceAndLocalization.UseIDEAddFileRes();
            //global::ConsoleTest.ChapterOne.ResourceAndLocalization.UseManualAddFile();
            //global::ConsoleTest.ChapterOne.ResourceAndLocalization.UseManualStrongResClass();
            // global::ConsoleTest.ChapterOne.ResourceAndLocalization.UseOutterDLL();
            //ConsoleTest.ChapterOne.ResourceAndLocalization.LoadCultureInfo();

              #endregion

            #region 手动生成、部署及配置程序
          //global::ConsoleTest.ChapterThree.BuildAndSettings.SayHello();
          //global::ConsoleTest.ChapterThree.BuildAndSettings.UseAppSetting();
          #endregion

            #region 4 CLR

          //global::ConsoleTest.ChapterFour.AppDomain.EnumerateAssembly();
          //global::ConsoleTest.ChapterFour.AppDomain.LoadAssembly();
          //global::ConsoleTest.ChapterFour.AppDomain.RunInOtherAppDomian();
          //global::ConsoleTest.ChapterFour.AppDomain.DataAccessCrossDomain();

          #endregion 

            #region 5-进程、线程与同步

          //global::ConsoleTest.ChapterFive.Thread.GetNowProcess();
          //global::ConsoleTest.ChapterFive.Thread.CreateProcess();
          //global::ConsoleTest.ChapterFive.Thread.RunSingletonProcess();
          //global::ConsoleTest.ChapterFive.Thread.ThreadJoin();
          //global::ConsoleTest.ChapterFive.Thread.ThreadAbort();
          //global::ConsoleTest.ChapterFive.Thread.ThreadSuspend();

          //global::ConsoleTest.ChapterFive.Synchronous.NonSynchronized();
          //global::ConsoleTest.ChapterFive.Synchronous.InterLocked();
          //global::ConsoleTest.ChapterFive.Synchronous.Monitor();
          //global::ConsoleTest.ChapterFive.Synchronous.Locked();
          //global::ConsoleTest.ChapterFive.Synchronous.SyncRoot();
          //global::ConsoleTest.ChapterFive.Synchronous.PingPong();
          //global::ConsoleTest.ChapterFive.Synchronous.Mutex();
          //global::ConsoleTest.ChapterFive.Synchronous.EventReset();
          //global::ConsoleTest.ChapterFive.Synchronous.Semaphore();
          //global::ConsoleTest.ChapterFive.Synchronous.ReadWriterLock();
          //global::ConsoleTest.ChapterFive.Synchronous.ThreadSafeClass();
          //global::ConsoleTest.ChapterFive.Synchronous.ThreadPool();

          //global::ConsoleTest.ChapterFive.Timer.SystemTimer();

          //global::ConsoleTest.ChapterFive.Asynchronous.BeginInvoke();
          //global::ConsoleTest.ChapterFive.Asynchronous.InvokeCallBack();
          //global::ConsoleTest.ChapterFive.Asynchronous.SendStateToCallBack();

          //global::ConsoleTest.ChapterFive.Affinity.ThreadStatic();
          //global::ConsoleTest.ChapterFive.Affinity.NamedDataSlot();
          //global::ConsoleTest.ChapterFive.Affinity.UnNamedDataSlot();

          #endregion

            #region 6- CAS 安全性

          //global::ConsoleTest.ChapterSix.Security.DisplayStrongName();

          #endregion

            #region 7-反射、后期绑定与attribute

          //global::ConsoleTest.ChapterSeven.Reflection.ReflectionNowAppDomain();
          //global::ConsoleTest.ChapterSeven.Reflection.CreateObj_Activator();
          //global::ConsoleTest.ChapterSeven.Reflection.CreateObj_Type();
          //global::ConsoleTest.ChapterSeven.Reflection.CreateObj_AppDomain();
          //global::ConsoleTest.ChapterSeven.Reflection.CreateObj_Reflection();
          //global::ConsoleTest.ChapterSeven.Reflection.CreateObj_Type();
          //global::ConsoleTest.ChapterSeven.Reflection.InvokeMethod();
          //global::ConsoleTest.ChapterSeven.TestAssembly.Test();
          //global::ConsoleTest.ChapterSeven.DynamicAssembly.CallCommon();
          //global::ConsoleTest.ChapterSeven.DynamicAssembly.CallCustom();
          //global::ConsoleTest.ChapterSeven.DynamicAssembly.CallDynamic();

          #endregion

           #region 8-.NET与本机代码、COM、COM+互操作性

                  //global::ConsoleTest.ChapterEight.PInvoke.UseKernelBeep();
                  //global::ConsoleTest.ChapterEight.PInvoke.UseMsgBox();
                  //global::ConsoleTest.ChapterEight.PInvoke.GetString();

              #endregion

          #region  10-从.NET2.0角度看.NET 类型系统
          //global::ConsoleTest.ChapterTen.TypeSys.Equal();
          //global::ConsoleTest.ChapterTen.TypeSys.CalcTest();
          //global::ConsoleTest.ChapterTen.TypeSys.BitFlags();
          //global::ConsoleTest.ChapterTen.TypeSys.StrFormat();

          //global::ConsoleTest.ChapterTen.Delegate.DelegateList();

          #endregion

          #region 类和对象



          #endregion

          #region 抽象类等相关概念
          //AbstractTest.Test1();
            #endregion 

            #region 13  泛型

            //测试默认构造函数约束
            // GenericTest.TestGetNewU();

            //测试派生约束
            //GenericTest.TestDerivedChk();
            #endregion 泛型

            #region 14-不安全代码、异常、匿名方法与迭代器

            //固定数组测试
            // Pointer.FixedArrayTest();

            //char指针修改string
            //string str = "kewin";
            //Pointer.ToUpper(str);
            //Console.WriteLine(str);


            //匿名方法 2.0 新特性
            //Anonymous.AnonyDelegate();
            //Anonymous.AnonyMethodWithRef();
            //Anonymous.DelegateCounter();


            //Iterator_Enumerator._1_IEnumeratroTest();

            #endregion 

            #region 15  集合
            //CollectionTest.CreateArray();
            //JaggedArray.JaggedArrayTest();
            //CollectionTest.ArrayCast();

            #endregion

            #region 16  基类
            //StopWatchTest.StopWatchfun();

            //Directory.DirectoryInfoFun();
            //Directory.FileSysWatcherFun();
        
            //注册表操作
            //RegistryClass.RegistryKeyFun();

            //调试器个性化测试
            //Article art=new Article("shoes",111);

            //跟踪
            //System.Diagnostics.Trace.Listeners.Add(new System.Diagnostics.EventLogTraceListener());
            ////System.Diagnostics.Trace.Listeners.Add(new System.Diagnostics.ConsoleTraceListener());
            //System.Diagnostics.Trace.WriteLine(" System.Diagnostics.Trace.WriteLine Function");
            //System.Diagnostics.Debug.WriteLine(" System.Diagnostics.Debug.WriteLine Function");
            #endregion

            #region 17-输入输出与流操作

            //StreamTest.SimpleFileAccess();
            //StreamTest.FileStreamCopy();
            //StreamTest.StreamWRCopyFile();

            //StreamTest.AccessStreamAsync();

            //NetStreamTest.ServerWaitForClient();
            //NetStreamTest.SerProcessClientAsync();
            //NetStreamTest.GetNetWorkInterface();
            //NetStreamTest.Ping();
           // NetStreamTest.WebClient();
            //NetStreamTest.HttpSYS();
            //NetStreamTest.HTTPSYSAsync();
            //NetStreamTest.SmtpClient();


            //StreamTest.CreateBlobFileTest();

            #endregion 输入输出与流操作

            #region 19  ADO.NET
           // ADONETTest.DataRelationTest();
            //ADONETTest.FillAndChange();
            //ADONETTest.TypedDataSetTest();
            //ADONETTest.TypedDataSetQuery();
            #endregion 19ADO.NET


            #region 21  XMLTEST
            //XMLTest.UseXmlReader();
            //XMLTest.UseXmlReaderWithChk();
            //XMLTest.UseXmlWriter();
            //XMLTest.UseXmlDoucmetRead();
            //XMLTest.UseXPath();
            //XMLTest.UseXPahtNavigator();
            //XMLTest.UseXPathNodeIterator();
            //XMLTest.UseXpathNavWriteXml();
            //XMLTest.UseXSLT();
            //XMLTest.DataSetToXml();
            //XMLTest.XmlDataFillDataSet();
            // XMLTest.UseXmlDataDocument();
            //XMLTest.DataSetCompareToXmlDataDoc();
            //XMLTest.UseSqlXml();
            //XMLTest.XmlWithDataEntity();
            //XMLTest.XmlWithDataEntityAttr();
            //XMLTest.UseSerializer();
            #endregion XMLTEST

            #region 22 .NET Remoting

            #endregion

            #region 伪随机算法
            ////SRandom.RandomCosole();
            #endregion 伪随机算法


            Console.ReadLine();
        }


        //static void f_RefTest()
        //{
        //    RefTest refA = null;
        //    RefTest refB = null;
        //    RefTest.fct(ref refA, refB);

        //    if (refA == null)
        //        System.Console.WriteLine("refA is null");
        //    else
        //        System.Console.WriteLine("refA now references the RefTest allocated in fct");
        //    if (refB == null)
        //        System.Console.WriteLine("refB is null");
        //    else
        //        System.Console.WriteLine("refB now references the RefTest allocated in fct");

        //    System.Console.ReadLine();
        //}

        //static void TestString(ref string str1, string str2)
        //{

        //    //此处创建了一个新的string实例，并修改了str1引用的指向
        //    str1 = "new str1";
        //    //创建一个新的string实例，在方法内部修改str2的引用
        //    str2 = "new str2";
        //}
    }
}
